<template>
	<div class="Body">
		<div class="search">
			<!-- <a-input-search
        placeholder="input search text"
        enter-button="Search"
        size="large"
        
        style="width: 942px; margin-top: 36px"
        v-model="input"
        @click="search()"
      /> -->
			<el-input placeholder="请输入进行搜索" v-model="input" clearable size="medium"
				style="width: 942px; margin-top: 36px">
				<el-button type="primary" style="background-color:#409eff;width:80px" slot="append"
					icon="el-icon-search" @click="search()"></el-button>
			</el-input>
			<div class="hotSearch">
				<div>
					<a-menu mode="horizontal" style="display: flex; justify-content: space-around">
						<a-menu-item key="1" disabled> 搜索排行： </a-menu-item>
						<a-menu-item key="2"> 项目经理 </a-menu-item>
						<a-menu-item key="3"> Java开发 </a-menu-item>
						<a-menu-item key="4"> Web前端 </a-menu-item>
						<a-menu-item key="5"> 数据库开发 </a-menu-item>
					</a-menu>
				</div>
			</div>
		</div>
		<!-- <Search></Search>
</div>  -->

		<div class="containe">
			<!-- <Fliterss></Fliterss> -->
			<div class="Qintor">
				<Container></Container>
			</div>
			<div class="table">

				<el-table :data="data" stripe style="width: 100%">
					<!-- <el-table-column type="avater"  label="卡通头像">
          </el-table-column> -->
					<el-table-column v-for="column in columns" :key='column.key' :label="column.title"
						:prop="column.key">
					</el-table-column>
					<!-- <el-table-column fixed="right" label="操作">
		    <template slot-scope="scope">
		      <el-button @click="editShow(scope.row.resumeKey)" type="warning" size="mini">投递</el-button>
		    </template> -->
					<!-- <el-table-column prop="name" label="姓名">
          </el-table-column>
          <el-table-column prop="age" label="年龄">
          </el-table-column>
          <el-table-column prop="workyear" label="工作年限">
          </el-table-column>
          <el-table-column prop="position" label="职位">
          </el-table-column>
          <el-table-column prop="learn" label="学历">
          </el-table-column>
          <el-table-column prop="place" label="地点">
          </el-table-column>
          <el-table-column prop="time" label="更新时间">
          </el-table-column> -->
				</el-table>
			</div>
			<!-- 分页插件 -->
			<el-pagination layout="total, sizes, prev, next, pager, jumper" @size-change="sizeChange"
				@current-change="currentChange" :page-sizes="[2, 5, 10, 50]" :page-size="2" :total="total">
			</el-pagination>
		</div>
	</div>
</template>

<script>
	import Container from "../index/TalentContainer";
	import axios from "axios"
	// import Fliterss from "../index/fliter"
	// import Search from "../index/Search";

	const data = [{

			resumeName: "李小钳子",
			workTime: "1",
			appliedPosition: "前端工程师",
			exceptedWorkplace: "",
			expectedSalary: "本科",
			houseAddress: "北京",
			createDate: "2015-12-28",
			updateDate: "",
		},

	];
	
	const data2 = [{
	
			resumeName: "李小钳子",
			workTime: "1",
			appliedPosition: "前端工程师",
			exceptedWorkplace: "",
			expectedSalary: "本科",
			houseAddress: "北京",
			createDate: "2015-12-28",
			updateDate: "",
		},
	
	];
	
	const data3 = [{
	
			resumeName: "李小钳子",
			workTime: "1",
			appliedPosition: "前端工程师",
			exceptedWorkplace: "",
			expectedSalary: "本科",
			houseAddress: "北京",
			createDate: "2015-12-28",
			updateDate: "",
		},
	
	];


	export default {
		components: {
			Container,
		},

		data() {
			return {
				searchs: [],
				pageNum: 1,
				size: 2,
				input: null,
				pageNum: 1,
				size: 2,
				data,
				data2,
				data3,
				columns: [
					/* {
					  title: "id",
					  dataIndex: "id",
					  key: "id",
					  ellipsis: true,
					}, */
					{
						title: "姓名",
						dataIndex: "resumeName",
						key: "resumeName",
						scopedSlots: {
							customRender: "resumeName"
						},
					},
					{
						title: "工作年限",
						dataIndex: "workTime ",
						key: "workTime",
					},
					{
						title: "地点",
						dataIndex: "houseAddress",
						key: "houseAddress",
						ellipsis: true,
					},
					{
						title: "职位",
						dataIndex: "appliedPosition ",
						key: "appliedPosition",
						ellipsis: true,
					},
					{
						title: "预期工作地址",
						dataIndex: "exceptedWorkplace ",
						key: "exceptedWorkplace",
						ellipsis: true,
					},
					{
						title: "预期薪水",
						dataIndex: "expectedSalary  ",
						key: "expectedSalary",
						ellipsis: true,
					},
					{
						title: "发布日期",
						dataIndex: "createDate",
						key: "createDate",
						ellipsis: true,
					},
					{
						title: "更新时间",
						dataIndex: "updateDate",
						key: "updateDate",
						ellipsis: true,
					},
				],
				searchtableData: [
					data,
					{
						qiye: "企业",
						rencai: "人才",
						geren: "个人",
						zhuanjia: "专家",
						gongsi: "公司",
						jiekou: "接口"
					},
				],


			};
		},
		mounted() {
			this.list();
		},
		methods: {
			onSearch(value) {
				console.log(value);
			},
			sizeChange: function(s) {
				console.log(s);
				this.size = s;
				this.list();
			},
			currentChange: function(i) {
				console.log(i);
				this.pageNum = i;
				this.list();
			},
			list: function() {
				axios.get("http://localhost:9003/resume/list", {
					params: {
						pageNum: this.pageNum,
						size: this.size,
					}
				}).then((response) => {
					console.log(response.data);
					this.data = response.data.list;
					this.data2 = response.data.list;
					this.total = response.data.total;
				})
			},

			// 查找
			search: function() {
				console.log(this.input);
				if (this.input == null || this.input == "") {
					this.data = this.data2;
					return;
				}else if(this.input =='企业'){
					this.$router.push("http://localhost:8080/login/nav");
				}else{
					axios.get("http://localhost:9003/resume/getcompanysinfo",
						{params:{content:this.input}},
						).then((response)=>{
							console.log(response.data.data.data);
							//response.data.data;
							//console.log(this.data)
							this.data3=response.data.data.data
							console.log(this.data3)
							this.data=this.data3
					})
				}
			},
		},
	};
</script>

<style scoped>
	.search {
		height: 100px;
	}

	.ant-carousel>>>.slick-slide {
		text-align: center;
		height: 300px;
		line-height: 300px;
		/* background: #364d79; */
		overflow: hidden;
	}

	.ant-descriptions-bordered .ant-descriptions-item-label,
	.ant-descriptions-bordered .ant-descriptions-item-content {
		padding: 16px 22px;
		border-right: 1px solid #e8e8e8;
	}

	.hotSearch {
		width: 800px;
		margin-left: 75px;
		margin-top: -30px;
	}

	.ant-menu-horizontal>.ant-menu-item:hover,
	.ant-menu-horizontal>.ant-menu-submenu:hover,
	.ant-menu-horizontal>.ant-menu-item-active,
	.ant-menu-horizontal>.ant-menu-submenu-active,
	.ant-menu-horizontal>.ant-menu-item-open,
	.ant-menu-horizontal>.ant-menu-submenu-open,
	.ant-menu-horizontal>.ant-menu-item-selected,
	.ant-menu-horizontal>.ant-menu-submenu-selected {
		color: #1890ff;
		border-bottom: none;
	}

	.Qintor {
		width: 940px;
		height: 350px;
		margin-left: 34px;
		margin-top: 48px;
	}

	.table {
		margin-top: -52px;
		/* margin: 31px; */
		margin-left: 34px;
		margin-right: 48px;
	}
</style>
